{"ast":null,"code":"import _toConsumableArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { ActionTypes } from './useListbox.types';\nvar pageSize = 5;\nfunction findValidOptionToHighlight(index, lookupDirection, options, focusDisabled, isOptionDisabled, wrapAround) {\n  if (options.length === 0 || options.every(function (o, i) {\n    return isOptionDisabled(o, i);\n  })) {\n    return -1;\n  }\n  var nextFocus = index;\n  for (;;) {\n    // No valid options found\n    if (!wrapAround && lookupDirection === 'next' && nextFocus === options.length || !wrapAround && lookupDirection === 'previous' && nextFocus === -1) {\n      return -1;\n    }\n    var nextFocusDisabled = focusDisabled ? false : isOptionDisabled(options[nextFocus], nextFocus);\n    if (nextFocusDisabled) {\n      nextFocus += lookupDirection === 'next' ? 1 : -1;\n      if (wrapAround) {\n        nextFocus = (nextFocus + options.length) % options.length;\n      }\n    } else {\n      return nextFocus;\n    }\n  }\n}\nfunction getNewHighlightedOption(options, previouslyHighlightedOption, diff, lookupDirection, highlightDisabled, isOptionDisabled, wrapAround, optionComparer) {\n  var _options$nextIndex;\n  var maxIndex = options.length - 1;\n  var defaultHighlightedIndex = -1;\n  var nextIndexCandidate;\n  var previouslyHighlightedIndex = previouslyHighlightedOption == null ? -1 : options.findIndex(function (option) {\n    return optionComparer(option, previouslyHighlightedOption);\n  });\n  if (diff === 'reset') {\n    var _options$defaultHighl;\n    return defaultHighlightedIndex === -1 ? null : (_options$defaultHighl = options[defaultHighlightedIndex]) != null ? _options$defaultHighl : null;\n  }\n  if (diff === 'start') {\n    nextIndexCandidate = 0;\n  } else if (diff === 'end') {\n    nextIndexCandidate = maxIndex;\n  } else {\n    var newIndex = previouslyHighlightedIndex + diff;\n    if (newIndex < 0) {\n      if (!wrapAround && previouslyHighlightedIndex !== -1 || Math.abs(diff) > 1) {\n        nextIndexCandidate = 0;\n      } else {\n        nextIndexCandidate = maxIndex;\n      }\n    } else if (newIndex > maxIndex) {\n      if (!wrapAround || Math.abs(diff) > 1) {\n        nextIndexCandidate = maxIndex;\n      } else {\n        nextIndexCandidate = 0;\n      }\n    } else {\n      nextIndexCandidate = newIndex;\n    }\n  }\n  var nextIndex = findValidOptionToHighlight(nextIndexCandidate, lookupDirection, options, highlightDisabled, isOptionDisabled, wrapAround);\n  return (_options$nextIndex = options[nextIndex]) != null ? _options$nextIndex : null;\n}\nfunction handleOptionSelection(option, state, props) {\n  var multiple = props.multiple,\n    _props$optionComparer = props.optionComparer,\n    optionComparer = _props$optionComparer === void 0 ? function (o, v) {\n      return o === v;\n    } : _props$optionComparer,\n    _props$isOptionDisabl = props.isOptionDisabled,\n    isOptionDisabled = _props$isOptionDisabl === void 0 ? function () {\n      return false;\n    } : _props$isOptionDisabl;\n  var selectedValue = state.selectedValue;\n  var optionIndex = props.options.findIndex(function (o) {\n    return props.optionComparer(option, o);\n  });\n  if (isOptionDisabled(option, optionIndex)) {\n    return state;\n  }\n  if (multiple) {\n    var _ref, _ref2;\n    var selectedValues = (_ref = selectedValue) != null ? _ref : []; // if the option is already selected, remove it from the selection, otherwise add it\n\n    var newSelectedValues = selectedValues.some(function (sv) {\n      return optionComparer(sv, option);\n    }) ? selectedValue.filter(function (v) {\n      return !optionComparer(v, option);\n    }) : [].concat(_toConsumableArray((_ref2 = selectedValue) != null ? _ref2 : []), [option]);\n    return {\n      selectedValue: newSelectedValues,\n      highlightedValue: option\n    };\n  }\n  if (selectedValue != null && optionComparer(option, selectedValue)) {\n    return state;\n  }\n  return {\n    selectedValue: option,\n    highlightedValue: option\n  };\n}\nfunction handleKeyDown(event, state, props) {\n  var options = props.options,\n    isOptionDisabled = props.isOptionDisabled,\n    disableListWrap = props.disableListWrap,\n    disabledItemsFocusable = props.disabledItemsFocusable,\n    optionComparer = props.optionComparer;\n  var moveHighlight = function moveHighlight(diff, direction, wrapAround) {\n    return getNewHighlightedOption(options, state.highlightedValue, diff, direction, disabledItemsFocusable != null ? disabledItemsFocusable : false, isOptionDisabled != null ? isOptionDisabled : function () {\n      return false;\n    }, wrapAround, optionComparer);\n  };\n  switch (event.key) {\n    case 'Home':\n      return _extends({}, state, {\n        highlightedValue: moveHighlight('start', 'next', false)\n      });\n    case 'End':\n      return _extends({}, state, {\n        highlightedValue: moveHighlight('end', 'previous', false)\n      });\n    case 'PageUp':\n      return _extends({}, state, {\n        highlightedValue: moveHighlight(-pageSize, 'previous', false)\n      });\n    case 'PageDown':\n      return _extends({}, state, {\n        highlightedValue: moveHighlight(pageSize, 'next', false)\n      });\n    case 'ArrowUp':\n      // TODO: extend current selection with Shift modifier\n      return _extends({}, state, {\n        highlightedValue: moveHighlight(-1, 'previous', !(disableListWrap != null ? disableListWrap : false))\n      });\n    case 'ArrowDown':\n      // TODO: extend current selection with Shift modifier\n      return _extends({}, state, {\n        highlightedValue: moveHighlight(1, 'next', !(disableListWrap != null ? disableListWrap : false))\n      });\n    case 'Enter':\n    case ' ':\n      if (state.highlightedValue === null) {\n        return state;\n      }\n      return handleOptionSelection(state.highlightedValue, state, props);\n    default:\n      break;\n  }\n  return state;\n}\nfunction handleBlur(state) {\n  return _extends({}, state, {\n    highlightedValue: null\n  });\n}\nvar textCriteriaMatches = function textCriteriaMatches(nextFocus, searchString, stringifyOption) {\n  var _stringifyOption;\n  var text = (_stringifyOption = stringifyOption(nextFocus)) == null ? void 0 : _stringifyOption.trim().toLowerCase();\n  if (!text || text.length === 0) {\n    // Make option not navigable if stringification fails or results in empty string.\n    return false;\n  }\n  return text.indexOf(searchString) === 0;\n};\nfunction handleTextNavigation(state, searchString, props) {\n  var options = props.options,\n    isOptionDisabled = props.isOptionDisabled,\n    disableListWrap = props.disableListWrap,\n    disabledItemsFocusable = props.disabledItemsFocusable,\n    optionComparer = props.optionComparer,\n    optionStringifier = props.optionStringifier;\n  var moveHighlight = function moveHighlight(previouslyHighlightedOption) {\n    return getNewHighlightedOption(options, previouslyHighlightedOption, 1, 'next', disabledItemsFocusable != null ? disabledItemsFocusable : false, isOptionDisabled != null ? isOptionDisabled : function () {\n      return false;\n    }, !(disableListWrap != null ? disableListWrap : false), optionComparer);\n  };\n  var startWithCurrentOption = searchString.length > 1;\n  var nextOption = startWithCurrentOption ? state.highlightedValue : moveHighlight(state.highlightedValue); // use `for` instead of `while` prevent infinite loop\n\n  for (var index = 0; index < options.length; index += 1) {\n    // Return un-mutated state if looped back to the currently highlighted value\n    if (!nextOption || !startWithCurrentOption && state.highlightedValue === nextOption) {\n      return state;\n    }\n    if (textCriteriaMatches(nextOption, searchString, optionStringifier) && (!isOptionDisabled(nextOption, options.indexOf(nextOption)) || disabledItemsFocusable)) {\n      // The nextOption is the element to be highlighted\n      return _extends({}, state, {\n        highlightedValue: nextOption\n      });\n    } // Move to the next element.\n\n    nextOption = moveHighlight(nextOption);\n  } // No option match text search criteria\n\n  return state;\n}\nfunction handleOptionsChange(options, previousOptions, state, props) {\n  var _options$find, _options$find2;\n  var multiple = props.multiple,\n    optionComparer = props.optionComparer;\n  var newHighlightedOption = state.highlightedValue == null ? null : (_options$find = options.find(function (option) {\n    return optionComparer(option, state.highlightedValue);\n  })) != null ? _options$find : null;\n  if (multiple) {\n    var _ref3;\n\n    // exclude selected values that are no longer in the options\n    var selectedValues = (_ref3 = state.selectedValue) != null ? _ref3 : [];\n    var newSelectedValues = selectedValues.filter(function (selectedValue) {\n      return options.some(function (option) {\n        return optionComparer(option, selectedValue);\n      });\n    });\n    return {\n      highlightedValue: newHighlightedOption,\n      selectedValue: newSelectedValues\n    };\n  }\n  var newSelectedValue = (_options$find2 = options.find(function (option) {\n    return optionComparer(option, state.selectedValue);\n  })) != null ? _options$find2 : null;\n  return {\n    highlightedValue: newHighlightedOption,\n    selectedValue: newSelectedValue\n  };\n}\nexport default function defaultListboxReducer(state, action) {\n  var type = action.type;\n  switch (type) {\n    case ActionTypes.keyDown:\n      return handleKeyDown(action.event, state, action.props);\n    case ActionTypes.optionClick:\n      return handleOptionSelection(action.option, state, action.props);\n    case ActionTypes.blur:\n      return handleBlur(state);\n    case ActionTypes.setValue:\n      return _extends({}, state, {\n        selectedValue: action.value\n      });\n    case ActionTypes.setHighlight:\n      return _extends({}, state, {\n        highlightedValue: action.highlight\n      });\n    case ActionTypes.textNavigation:\n      return handleTextNavigation(state, action.searchString, action.props);\n    case ActionTypes.optionsChange:\n      return handleOptionsChange(action.options, action.previousOptions, state, action.props);\n    default:\n      return state;\n  }\n}","map":{"version":3,"names":["_extends","ActionTypes","pageSize","findValidOptionToHighlight","index","lookupDirection","options","focusDisabled","isOptionDisabled","wrapAround","length","every","o","i","nextFocus","nextFocusDisabled","getNewHighlightedOption","previouslyHighlightedOption","diff","highlightDisabled","optionComparer","_options$nextIndex","maxIndex","defaultHighlightedIndex","nextIndexCandidate","previouslyHighlightedIndex","findIndex","option","_options$defaultHighl","newIndex","Math","abs","nextIndex","handleOptionSelection","state","props","multiple","v","selectedValue","optionIndex","_ref","_ref2","selectedValues","newSelectedValues","some","sv","filter","highlightedValue","handleKeyDown","event","disableListWrap","disabledItemsFocusable","moveHighlight","direction","key","handleBlur","textCriteriaMatches","searchString","stringifyOption","_stringifyOption","text","trim","toLowerCase","indexOf","handleTextNavigation","optionStringifier","startWithCurrentOption","nextOption","handleOptionsChange","previousOptions","_options$find","_options$find2","newHighlightedOption","find","_ref3","newSelectedValue","defaultListboxReducer","action","type","keyDown","optionClick","blur","setValue","value","setHighlight","highlight","textNavigation","optionsChange"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@mui/base/ListboxUnstyled/defaultListboxReducer.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { ActionTypes } from './useListbox.types';\nconst pageSize = 5;\n\nfunction findValidOptionToHighlight(index, lookupDirection, options, focusDisabled, isOptionDisabled, wrapAround) {\n  if (options.length === 0 || options.every((o, i) => isOptionDisabled(o, i))) {\n    return -1;\n  }\n\n  let nextFocus = index;\n\n  for (;;) {\n    // No valid options found\n    if (!wrapAround && lookupDirection === 'next' && nextFocus === options.length || !wrapAround && lookupDirection === 'previous' && nextFocus === -1) {\n      return -1;\n    }\n\n    const nextFocusDisabled = focusDisabled ? false : isOptionDisabled(options[nextFocus], nextFocus);\n\n    if (nextFocusDisabled) {\n      nextFocus += lookupDirection === 'next' ? 1 : -1;\n\n      if (wrapAround) {\n        nextFocus = (nextFocus + options.length) % options.length;\n      }\n    } else {\n      return nextFocus;\n    }\n  }\n}\n\nfunction getNewHighlightedOption(options, previouslyHighlightedOption, diff, lookupDirection, highlightDisabled, isOptionDisabled, wrapAround, optionComparer) {\n  var _options$nextIndex;\n\n  const maxIndex = options.length - 1;\n  const defaultHighlightedIndex = -1;\n  let nextIndexCandidate;\n  const previouslyHighlightedIndex = previouslyHighlightedOption == null ? -1 : options.findIndex(option => optionComparer(option, previouslyHighlightedOption));\n\n  if (diff === 'reset') {\n    var _options$defaultHighl;\n\n    return defaultHighlightedIndex === -1 ? null : (_options$defaultHighl = options[defaultHighlightedIndex]) != null ? _options$defaultHighl : null;\n  }\n\n  if (diff === 'start') {\n    nextIndexCandidate = 0;\n  } else if (diff === 'end') {\n    nextIndexCandidate = maxIndex;\n  } else {\n    const newIndex = previouslyHighlightedIndex + diff;\n\n    if (newIndex < 0) {\n      if (!wrapAround && previouslyHighlightedIndex !== -1 || Math.abs(diff) > 1) {\n        nextIndexCandidate = 0;\n      } else {\n        nextIndexCandidate = maxIndex;\n      }\n    } else if (newIndex > maxIndex) {\n      if (!wrapAround || Math.abs(diff) > 1) {\n        nextIndexCandidate = maxIndex;\n      } else {\n        nextIndexCandidate = 0;\n      }\n    } else {\n      nextIndexCandidate = newIndex;\n    }\n  }\n\n  const nextIndex = findValidOptionToHighlight(nextIndexCandidate, lookupDirection, options, highlightDisabled, isOptionDisabled, wrapAround);\n  return (_options$nextIndex = options[nextIndex]) != null ? _options$nextIndex : null;\n}\n\nfunction handleOptionSelection(option, state, props) {\n  const {\n    multiple,\n    optionComparer = (o, v) => o === v,\n    isOptionDisabled = () => false\n  } = props;\n  const {\n    selectedValue\n  } = state;\n  const optionIndex = props.options.findIndex(o => props.optionComparer(option, o));\n\n  if (isOptionDisabled(option, optionIndex)) {\n    return state;\n  }\n\n  if (multiple) {\n    var _ref, _ref2;\n\n    const selectedValues = (_ref = selectedValue) != null ? _ref : []; // if the option is already selected, remove it from the selection, otherwise add it\n\n    const newSelectedValues = selectedValues.some(sv => optionComparer(sv, option)) ? selectedValue.filter(v => !optionComparer(v, option)) : [...((_ref2 = selectedValue) != null ? _ref2 : []), option];\n    return {\n      selectedValue: newSelectedValues,\n      highlightedValue: option\n    };\n  }\n\n  if (selectedValue != null && optionComparer(option, selectedValue)) {\n    return state;\n  }\n\n  return {\n    selectedValue: option,\n    highlightedValue: option\n  };\n}\n\nfunction handleKeyDown(event, state, props) {\n  const {\n    options,\n    isOptionDisabled,\n    disableListWrap,\n    disabledItemsFocusable,\n    optionComparer\n  } = props;\n\n  const moveHighlight = (diff, direction, wrapAround) => {\n    return getNewHighlightedOption(options, state.highlightedValue, diff, direction, disabledItemsFocusable != null ? disabledItemsFocusable : false, isOptionDisabled != null ? isOptionDisabled : () => false, wrapAround, optionComparer);\n  };\n\n  switch (event.key) {\n    case 'Home':\n      return _extends({}, state, {\n        highlightedValue: moveHighlight('start', 'next', false)\n      });\n\n    case 'End':\n      return _extends({}, state, {\n        highlightedValue: moveHighlight('end', 'previous', false)\n      });\n\n    case 'PageUp':\n      return _extends({}, state, {\n        highlightedValue: moveHighlight(-pageSize, 'previous', false)\n      });\n\n    case 'PageDown':\n      return _extends({}, state, {\n        highlightedValue: moveHighlight(pageSize, 'next', false)\n      });\n\n    case 'ArrowUp':\n      // TODO: extend current selection with Shift modifier\n      return _extends({}, state, {\n        highlightedValue: moveHighlight(-1, 'previous', !(disableListWrap != null ? disableListWrap : false))\n      });\n\n    case 'ArrowDown':\n      // TODO: extend current selection with Shift modifier\n      return _extends({}, state, {\n        highlightedValue: moveHighlight(1, 'next', !(disableListWrap != null ? disableListWrap : false))\n      });\n\n    case 'Enter':\n    case ' ':\n      if (state.highlightedValue === null) {\n        return state;\n      }\n\n      return handleOptionSelection(state.highlightedValue, state, props);\n\n    default:\n      break;\n  }\n\n  return state;\n}\n\nfunction handleBlur(state) {\n  return _extends({}, state, {\n    highlightedValue: null\n  });\n}\n\nconst textCriteriaMatches = (nextFocus, searchString, stringifyOption) => {\n  var _stringifyOption;\n\n  const text = (_stringifyOption = stringifyOption(nextFocus)) == null ? void 0 : _stringifyOption.trim().toLowerCase();\n\n  if (!text || text.length === 0) {\n    // Make option not navigable if stringification fails or results in empty string.\n    return false;\n  }\n\n  return text.indexOf(searchString) === 0;\n};\n\nfunction handleTextNavigation(state, searchString, props) {\n  const {\n    options,\n    isOptionDisabled,\n    disableListWrap,\n    disabledItemsFocusable,\n    optionComparer,\n    optionStringifier\n  } = props;\n\n  const moveHighlight = previouslyHighlightedOption => {\n    return getNewHighlightedOption(options, previouslyHighlightedOption, 1, 'next', disabledItemsFocusable != null ? disabledItemsFocusable : false, isOptionDisabled != null ? isOptionDisabled : () => false, !(disableListWrap != null ? disableListWrap : false), optionComparer);\n  };\n\n  const startWithCurrentOption = searchString.length > 1;\n  let nextOption = startWithCurrentOption ? state.highlightedValue : moveHighlight(state.highlightedValue); // use `for` instead of `while` prevent infinite loop\n\n  for (let index = 0; index < options.length; index += 1) {\n    // Return un-mutated state if looped back to the currently highlighted value\n    if (!nextOption || !startWithCurrentOption && state.highlightedValue === nextOption) {\n      return state;\n    }\n\n    if (textCriteriaMatches(nextOption, searchString, optionStringifier) && (!isOptionDisabled(nextOption, options.indexOf(nextOption)) || disabledItemsFocusable)) {\n      // The nextOption is the element to be highlighted\n      return _extends({}, state, {\n        highlightedValue: nextOption\n      });\n    } // Move to the next element.\n\n\n    nextOption = moveHighlight(nextOption);\n  } // No option match text search criteria\n\n\n  return state;\n}\n\nfunction handleOptionsChange(options, previousOptions, state, props) {\n  var _options$find, _options$find2;\n\n  const {\n    multiple,\n    optionComparer\n  } = props;\n  const newHighlightedOption = state.highlightedValue == null ? null : (_options$find = options.find(option => optionComparer(option, state.highlightedValue))) != null ? _options$find : null;\n\n  if (multiple) {\n    var _ref3;\n\n    // exclude selected values that are no longer in the options\n    const selectedValues = (_ref3 = state.selectedValue) != null ? _ref3 : [];\n    const newSelectedValues = selectedValues.filter(selectedValue => options.some(option => optionComparer(option, selectedValue)));\n    return {\n      highlightedValue: newHighlightedOption,\n      selectedValue: newSelectedValues\n    };\n  }\n\n  const newSelectedValue = (_options$find2 = options.find(option => optionComparer(option, state.selectedValue))) != null ? _options$find2 : null;\n  return {\n    highlightedValue: newHighlightedOption,\n    selectedValue: newSelectedValue\n  };\n}\n\nexport default function defaultListboxReducer(state, action) {\n  const {\n    type\n  } = action;\n\n  switch (type) {\n    case ActionTypes.keyDown:\n      return handleKeyDown(action.event, state, action.props);\n\n    case ActionTypes.optionClick:\n      return handleOptionSelection(action.option, state, action.props);\n\n    case ActionTypes.blur:\n      return handleBlur(state);\n\n    case ActionTypes.setValue:\n      return _extends({}, state, {\n        selectedValue: action.value\n      });\n\n    case ActionTypes.setHighlight:\n      return _extends({}, state, {\n        highlightedValue: action.highlight\n      });\n\n    case ActionTypes.textNavigation:\n      return handleTextNavigation(state, action.searchString, action.props);\n\n    case ActionTypes.optionsChange:\n      return handleOptionsChange(action.options, action.previousOptions, state, action.props);\n\n    default:\n      return state;\n  }\n}"],"mappings":";AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,IAAMC,QAAQ,GAAG,CAAC;AAElB,SAASC,0BAA0B,CAACC,KAAK,EAAEC,eAAe,EAAEC,OAAO,EAAEC,aAAa,EAAEC,gBAAgB,EAAEC,UAAU,EAAE;EAChH,IAAIH,OAAO,CAACI,MAAM,KAAK,CAAC,IAAIJ,OAAO,CAACK,KAAK,CAAC,UAACC,CAAC,EAAEC,CAAC;IAAA,OAAKL,gBAAgB,CAACI,CAAC,EAAEC,CAAC,CAAC;EA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